package com.yuanqi.ExceptionCatcher;


import com.yuanqi.Common.Expriess.BaseException;
import com.yuanqi.Return.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
@Slf4j
public class ExceptionCatcher {

    @ExceptionHandler
    public Result catcher(Exception e)
    {
        log.error("错误:",e);
        return Result.error(e.getMessage());
    }
}
